<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery-3.1.1.js"></script>
		<script>
//			$(function(){
//			$("span").bind("click",function(){
//			var txt = $('#msg').html()+"<p>内层span元素被点击</p>";
//			$('#msg').html(txt)
//			return false;
//		
//		});
//				$("#content").bind("click",function(){
//			var txt = $('#msg').html()+"<p>外层span元素被点击</p>";
//			$('#msg').html(txt)
//			return false;
//		});
//	
//		$("body").bind("click",function(){
//			var txt = $('#msg').html()+"<p>body元素被点击</p>";
//			$('#msg').html(txt)
//		});
//		$('span').click(function(event){
//      	alert("current mouse position:"+event.pageX+","+event.pageY);
//      	
//	});
//	})
//	
		</script>
		<style>
#kt{
	position: relative;
	height: 100px;
	width: 100px;
	border: 1px solid #005000;
	background: black;
	cursor: pointer;
}			 
#xxx{
	position: absolute;
	height: 1000px;
	width: 1100px;
	top:200px;
	left: 300px;
			}
		</style>
</head>
<body>
	<div id="content">
		外层div元素
		<span>层内span元素</span>
		外层div元素
	</div>
	<div id="msg"></div>

	<p id="q">45,45,64,56,41,44,2,34,85,85,85,4,95,96,95,</p>
	<p id="q1">请找出上面第二大的数</p>
	
	<input type="button" value="按钮" onclick="lookfor()" />
	<p id="a"></p>
	
	
	<div class="b_117">
	<input type="button" value="添加自定义事件 "	id="btn" />
	<p id="test">
		<input type="text" placeholder="这里输入文字"  />
		
	</p>
	
	</div>
	<input type="button" value="hs" onclick="hs()" />
	<input type="button" value="ud" onclick="ud()" />
	<input type="button" value="fadeTo" onclick="fT()" />
	<div id="kt">
		
	</div>
	<script >
		for(var j;j<3 ;j++)
		{    
			setTimeout(function(){
				console.log(j);
			});
		}
		
		
		var arr = new Array(45,45,64,56,41,44,2,34,85,85,85,4,95,95,96);
		function lookfor(){
		
			var arr1 = new Array();
				for(var i =0;i<arr.length;i++){
				if(arr1.indexOf(arr[i]) == -1){
				　　　　arr1.push(arr[i]);
				　				　}
					}
				
				function sortNumber(a, b)
				{
				return b - a
				}
				
			 var c = (arr1.sort(sortNumber))
		
		  var txt1 ="上个数组第二大的数字是:"+ c[1]
		  $("#a").html(txt1);
		
		
	}   
	   var a=1;
	function hs(){
		if(a==1){
   		$("#test").fadeOut(1000)
   		a=0;
   	}
		else if(a==0){
			$("#test").fadeIn(1000)
			a=1;
		}
   	}
	function ud(){
   		$("#test").toggle(function(){
   			$(this).next().slideDown()},
   			function(){
   				$(this).next().slideUp()
   			}
   		)}
		$("#kt").click(function(){
			$(this).animate({left:"700px",opacity:"0.5"},3000)
			        .animate({top:"200px"},3000,function(){$(this).css("border","5px solid blue")})
			        .animate({"border-top":"300px"},1000)
			        .animate({"border-left":"300px"},1000)
			        .animate({"border-bottom":"300px"},1000)
				
			     
			
		})
   	  $("#kt").hover(function(){
   	  	$(this).stop(true)
   	  	 .animate({height:"150"},2000)
   	 	 .animate({width:"200"},2000);},
   	  	 function(){
   	  	 	$(this).stop(true)
   	  	 .animate({height:"22"},2000)
   	  	 .animate({width :"60"},2000);
   	  	 });
   	  	function fT(){
   	  	$("#kt").fadeTo(600,0.2);
   	  
   	  	}
   	  	
   	
	
	</script>
</body>
</html>
